<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="language" content="en" />
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/project.css" />
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/emptyform.css" />
<title><?php echo $this->pageTitle; ?></title>
</head>

<?php
$project = $this->project;
?>

<body>

<div id="page">

<div id="menu">
<ul>
	<li class="menuheader"><?php echo Yii::t('views','Owner'); ?><ul class="owner">
		<li>
			<div class="ownerlabel"><?php echo Yii::t('database', 'First Name'); ?></div>
			<div class="ownersep">&nbsp;: </div>
			<?php 
				if (Constants::isNullOrEmpty($project->owner->fullName))
					echo "&nbsp;";
				else
					echo $project->owner->fullName; 
			?>
		</li>
		<li>
			<div class="ownerlabel"><?php echo Yii::t('database', 'Activity'); ?></div>
			<div class="ownersep">&nbsp;: </div>
			<?php 
				if (Constants::isNullOrEmpty($project->activity))
					echo "&nbsp;";
				else
					echo $project->activity; 
			?>
		</li>
		<li>
			<div class="ownerlabel"><?php echo Yii::t('database', 'Born'); ?></div>
			<div class="ownersep">&nbsp;: </div>
			<?php 
				if (Constants::isNullOrEmpty($project->owner->birth_date))
					echo "&nbsp;";
				else
					echo Constants::convertDate($project->owner->birth_date, 'yyyy-MM-dd', 'dd MMMM yyyy'); 
			?>
		</li>
	</ul></li>
	<li class="menuheader"><?php echo Yii::t('views', 'Project'); ?><ul class="submenu">
		<li><?php echo CHtml::link(Yii::t('project', 'Home'), array('/adviser/project/show','id'=>$project->id)); ?></li>
		<li><?php echo CHtml::link(Yii::t('project', 'Printings'), array('/adviser/printing/list','project_id'=>$project->id)); ?></li>
		<!-- li><?php echo CHtml::link(Yii::t('project', 'Close project'), "javascript:alert('To be defined')"); ?></li -->
		<li><?php echo CHtml::link(Yii::t('project', 'Close window'), "javascript:window.close()"); ?></li>
	</ul></li>
	<li class="menuheader" id="meetings"><?php echo Yii::t('views', 'Meeting'); ?><ul class="submenu">
		<li><?php echo CHtml::link(Yii::t('project', 'New meeting'), array('/adviser/meeting/create','project_id' => $project->id)); ?></li>
		<?php 
			$meetings = array ();
			$meetingDates = array ();
			
			foreach ($project->meetings as $meeting) {
				$d = Yii::app()->dateFormatter->format('dd MMMM yyyy', $meeting->meeting_date);
				$url = $meeting->completed ? '/adviser/meeting/show' : '/adviser/meeting/edit';
				$key = Yii::app()->dateFormatter->format('yyyy-MM-dd', $meeting->meeting_date);
				
				$meetingDates[] = $key;
				$meetings[$key] = CHtml::link(Yii::app()->dateFormatter->format('dd MMMM yyyy', $meeting->meeting_date), array($url, 'id' => $meeting->id, 'project_id' => $meeting->project->id));
			}
			
			rsort($meetingDates);
			foreach ($meetingDates as $date)
			{
				echo "<li>" . $meetings[$date] . "</li>";
			}
		?>
	</ul></li>
</ul>
</div>


<div id="content">
<?php echo $content; ?>
</div><!-- content -->

<div id="footer">
Copyright &copy; 2009 <a href="http://www.harlie.fr" target="harlie">Harlie</a> - Tous droits r&eacute;serv&eacute;s - <?php echo Yii::powered(); ?>
</div>
<!-- footer -->

</div><!-- page -->
</body>

</html>